New Structures for Transformation-Based Generators
نویسنده
چکیده
The Problem: A serious problem of most pattern-directed, transformation-based program generators is that they are trying to achieve three mutually antagonistic goals simultaneously: 1) deeply factored and highly abstract operators and operands to gain the combinatorial programming leverage provided by compositions of abstractions, 2) high performance code in the generated program, and 3) small (i.e., practical) generation search spaces. Various program generators focus on one or two of these goals thereby often compromising the other goal(s). This paper will make the argument that this quandary is due in large measure to control and storage structure deficiencies of conventional transformation-based generators. While pattern-directed (PD) transformations (also called rules) make the specification of the transformations easy and, in fact, mostly do a pretty good job of refining (i.e., translating) domain specific abstractions into code, they often explode the search space when one is later trying to produce highly optimized code from deeply factored, inter-constrained abstract operators and operands. Since giving up the deep factoring of abstractions to reduce the search spaces also gives up the combinatorial programming leverage provided by the composition, it is not a good trade-off. The general form of the constraint propagation problem in program generation is NP complete [3]. What can one do? Don’t solve the general problem! Instead, solve specialized sub-problems that avoid search space explosions via metaprograms that use specialized storage and control structures as well as specialized strategies. Some such strategies and mechanisms have been employed in earlier generators (e.g., Draco) and some are introduced by the Anticipatory Optimization Generator (AOG) generator (e.g., Localization and Tag-Directed rules) [1-2]. Table 1 summarizes these sub-problems, the strategies used and the mechanisms that they employ. The remainder of the paper examines these strategies and their implementation structures. Phased Translation: Draco [4] attacks the problem of the large search spaces by defining distinct Domain Specific Languages (DSLs) and performing program generation by phased translation of higher level DSLs into successively lower level DSLs until a conventional programming language is reached. Since the operators and operands of the DSLs are distinct, this has the effect of implicitly grouping the translation rules so that only those rules relevant to the current DSL construct being translated are tried. In effect, this reduces one very large search space to a series of much smaller search spaces. Domain Specific Optimization: However, this strategy introduces another problem – complex generated code that explodes the number of cases needed to recognize each conceptual construct (e.g., (x + 0) and (0 + x) and x are all really the same). To solve this problem, Draco introduces an optimization phase between each DSL to DSL translation phase. This optimization phase converts the generated DSL code into a simpler, canonical form using rules that map from a domain (i.e., a DSL) to itself. These optimization rules use domain knowledge to perform optimizations. These optimizations are relatively simple using domain knowledge but are often extremely hard to do in a programming language because key domain knowledge has been translated away. Domain knowledge is the key leverage that makes the optimizations easy. Localization: AOG adopts these same strategies as a starting point but adds new strategies. DSLs significantly improve program productivity because they deal with large-grain data structures and large-grain operators and thereby allow a programmer to say a lot (i.e., express a lengthy computation) with a few symbols. Large-grain operators applied to large-grain data structures imply some kind of extended control structure such as a loop, a sequence of statements, a recursive function, or other structure. As one composes large-grain operators and operands together into longer expressions, each subexpression implies not only some computation (e.g., pixel addition) that will eventually be expressed in terms of atomic operators and data items (e.g., integer addition), but it also implies
منابع مشابه
On Generators in Archimedean Copulas
This study after reviewing construction methods of generators in Archimedean copulas (AC), proposes several useful lemmas related with generators of AC. Then a new trigonometric Archimedean family will be shown which is based on cotangent function. The generated new family is able to model the low dependence structures.
متن کاملPresenting a New Algorithm for Determining Optimal Replaceable Capacity of Conventional Power Plants by Renewable Power Plants Based on Monte Carlo Method
Given the substitution process of generators using renewable energy sources instead of conventional generators in modern power systems, this paper proposes a Monte Carlo based method to determine an optimal level of this change. At first, LOLE index of the system was calculated without wind power to obtain the reference index. Then, the wind turbine units are replaced with the conventional gene...
متن کاملEfficient generation of test data structures using constraint logic programming and program transformation
The goal of Bounded-Exhaustive Testing (BET) is the automatic generation of all test cases satisfying a given invariant, within a given size bound. When the test cases have a complex structure, the development of correct and efficient generators becomes a very challenging task. In this paper we use Constraint Logic Programming (CLP) to systematically develop generators of structurally complex t...
متن کاملOnline Aggregation of Coherent Generators Based on Electrical Parameters of Synchronous Generators
This paper proposes a novel approach for coherent generators online clustering in a large power system following a wide area disturbance. An interconnected power system may become unstable due to severe contingency when it is operated close to the stability boundaries. Hence, the bulk power system controlled islanding is the last resort to prevent catastrophic cascading outages and wide area bl...
متن کاملA New Control Structure for Transformation-Based Generators
A serious problem of most transformation-based generators is that they are trying to achieve three mutually antagonistic goals simultaneously: 1) deeply factored operators and operands to gain the combinatorial programming leverage provided by composition, 2) high performance code in the generated program, and 3) small (i.e., practical) generation search spaces. The hypothesis of this paper is ...
متن کاملCanonical bases for real representations of Clifford algebras
The well-known classification of the Clifford algebrasCl(r, s) leads to canonical forms of complex and real representations which are essentially unique by virtue of the Wedderburn theorem. For s ≥ 1 representations of Cl(r, s) on R are obtained from representations on R by adding two new generators while in passing from a representation of Cl(p, 0) on R to a representation of Cl(r, 0) on R the...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2002